Skip to content

fix: set max window clamp to current monitor size#13171

Merged
jcollie merged 1 commit into
ghostty-org:mainfrom
yak3d:max-window-clamp-fix
Jul 5, 2026
Merged

fix: set max window clamp to current monitor size#13171
jcollie merged 1 commit into
ghostty-org:mainfrom
yak3d:max-window-clamp-fix

Conversation

@yak3d

@yak3d yak3d commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

This PR fixes #7984. The issue was that GTK would clamp the window itself based on the display it was opened on. We fix this by computing the size based on the current display and then implicitly setting the window size instead of relying on GTK to do it.

Claude Code w/ Opus 4.7 was used to investigate, fix and explain some of the Ghostty architecture to me.

@yak3d yak3d requested a review from a team as a code owner July 3, 2026 13:57

@jcollie jcollie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change makes it so that new windows (on Gnome 50) starts out as a minimally sized window. It ignores the window-width and window-height configs completely. Not sure what DE you're testing with but this change won't be accepted until that is remedied.

@yak3d yak3d force-pushed the max-window-clamp-fix branch from 7885e3f to 9f6eb19 Compare July 4, 2026 16:43
@yak3d

yak3d commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

This change makes it so that new windows (on Gnome 50) starts out as a minimally sized window. It ignores the window-width and window-height configs completely. Not sure what DE you're testing with but this change won't be accepted until that is remedied.

I noticed that, and thought it was just a bad config on my end. Sorry about that. I resolved it by only overriding gtk's clamp when the window exceeds the bounds so it should open at the correct size now.

@yak3d yak3d requested a review from jcollie July 4, 2026 16:47

@jcollie jcollie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of small requests.

Comment thread src/apprt/gtk/class/window.zig
Comment thread src/apprt/gtk/class/window.zig Outdated
@yak3d yak3d force-pushed the max-window-clamp-fix branch from 9f6eb19 to 004c88e Compare July 5, 2026 14:42
@yak3d yak3d requested a review from jcollie July 5, 2026 14:42
@jcollie jcollie merged commit 715ef6c into ghostty-org:main Jul 5, 2026
93 checks passed
@github-actions github-actions Bot added this to the 1.4.0 milestone Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants